<?php
	class UserModel extends Model{
		// private $table='User';
		public function addUser(){
			$_POST['password']=Q('password',0,'md5');
			if($this->add()){
				return true;
			}else{
				return false;
			}
			
		}
		public function checkUser(){
			$username=Q('username');
			$password=Q('password',0,'md5');
			$re=$this->where(array('username'=>$username,'password'=>$password))->find();
			unset($re['password']);
			// p($re);
			if($re){
				return $re;
			}else{
				return false;
			}
		}
	}
?>